package com.libraryManage.service.impl;

import com.libraryManage.commons.utils.MVCUtil;
import com.libraryManage.commons.utils.ResponseEntity;
import com.libraryManage.mapper.HomePageMapper;
import com.libraryManage.service.HomePageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service //这个是对应xml查询语句的注解
public class HomePageServiceImpl implements HomePageService {

    @Autowired
    HomePageMapper homePageMapper;

    /**
     *
     * 总用户查询
     * @return
     */
    @Override
    public ResponseEntity<Integer> userCount() {
        int usercount=homePageMapper.userCount();
        return MVCUtil.response(usercount);
    }

    /**
     * 总图书查询
     * @return
     */
    @Override
    public ResponseEntity<Integer> bookCount() {
        int bookcount=homePageMapper.bookCount();
        return MVCUtil.response(bookcount);
    }


}
